<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../css/docs.css" type="text/css" rel="stylesheet" />
<link href="../css/prettify.css" type="text/css" rel="stylesheet" />
<script src="../js/prettify.js" type="text/javascript"></script>
</head>
<body onLoad="prettyPrint()">
<div class="g-unit" id="doc-content">
<div id="api-info-block">
<div class="api-level">H3C CAS云管理平台</div>
</div>
<div id="jd-header">
<h1>查询CAS系统中指定主机池下的主机列表</h1>
</div>
<div id="jd-content">
<div class="jd-descr">
<p>查询CAS系统中指定主机池下的主机列表。</p>
<h2><a name="uri"></a>接口 URI</h2>
<p>/cas/casrs/hostpool/host/{hpId}?hostName={hostName}&amp;offset={offset}&amp;limit={limit} </p>
<h2><a name="access"></a>访问方法</h2>
<dl>
  <dt><b>HTTP 方法</b></dt>
  <dd>GET</dd>
  <dt><b>参数</b></dt><table class="jd-sumtable" id="pubmethods">
    <tbody>
      <tr>
        <th colspan="2">路径参数（Path Parameter）</th>
      </tr>
      <tr>
        <td class="jd-typecol">hpId</td>
        <td class="jd-linkcol" width="100%"><span class="sympad">主机池id 。</span>
            <div class="jd-descrdiv">长整数（long）类型。必须。</div></td>
      </tr>
    </table>


  <table id="pubmethods" class="jd-sumtable">
    <tbody>
      <tr>
        <th colspan="2">路径参数（Query Parameter）</th>
      </tr>

      <tr>
        <td class="jd-typecol">hostName</td>
        <td width="100%" class="jd-linkcol"><span class="sympad">主机名称类型 。</span>
            <div class="jd-descrdiv">字符串（String）类型。可选。</div></td>
      </tr>
      <tr  class="alt-color">
        <td class="jd-typecol">offset</td>
        <td class="jd-linkcol"><span class="sympad">查询起始位置 。 </span>
            <div class="jd-descrdiv">整数（Integer）类型。必须。</div></td>
      </tr>
      <tr>
        <td class="jd-typecol">limit</td>
        <td class="jd-linkcol"><span class="sympad">查询返回数据量 。</span>
            <div class="jd-descrdiv">整数（Integer）类型。必须。</div></td>
      </tr>
    </table>
</dl>
<h2><a name="result"></a>返回结果</h2>
<dl>
  <dt><b>状态码</b></dt>
  <dd>
  <ul>
    <li>200(OK)：成功。</li>
  </ul>
  </dd>
  <dt><b>消息头</b></dt>
  <div class="source"><pre class="prettyprint lang-xml">HTTP/1.1 200 OK<br>Total: 1<br>Content-Type: application/xml<br>Content-Length: 370<br>Date: Tue, 16 Sep 2014 09:44:07 GMT
</pre>
  </div>
  <dt><b>消息体</b></dt>
  <div class="source">
    <pre class="prettyprint lang-xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;list&gt;<br>  &lt;host&gt;<br>    &lt;id&gt;4&lt;/id&gt;<br>    &lt;hostPoolId&gt;2&lt;/hostPoolId&gt;<br>    &lt;clusterId&gt;1&lt;/clusterId&gt;<br>    &lt;name&gt;server21&lt;/name&gt;<br>    &lt;vmNum&gt;31&lt;/vmNum&gt;<br>    &lt;vmRunCount&gt;29&lt;/vmRunCount&gt;<br>    &lt;vmShutoff&gt;2&lt;/vmShutoff&gt;<br>    &lt;cpuRate&gt;29.675&lt;/cpuRate&gt;<br>    &lt;memRate&gt;52.79483333333334&lt;/memRate&gt;<br>    &lt;status&gt;1&lt;/status&gt;<br>    &lt;storage&gt;884583&lt;/storage&gt;<br>    &lt;version&gt;CVK 2.0 (C0205)&lt;/version&gt;<br>  &lt;/host&gt;<br>&lt;/list&gt;  </pre>
  </div>
</dl>
<dt><a name="detail"></a><b>元素含义</b></dt>
<table class="jd-sumtable" id="pubmethods">
  <tbody>
    <tr>
      <th colspan="2"><span class="prettyprint lang-xml">host</span>各子元素</th>
    <tr>
      <td class="jd-typecol"><span class="prettyprint lang-xml">id</span></td>
      <td class="jd-linkcol" width="100%"><span class="sympad">主机 ID。</span>
          <div class="jd-descrdiv">长整型（Long）类型。</div></td>
    </tr>
    <tr class="alt-color">
      <td class="jd-typecol"><span class="prettyprint lang-xml">hostPoolId</span></td>
      <td class="jd-linkcol"><span class="sympad">主机池ID。</span>
          <div class="jd-descrdiv">长整型（Long）类型。</div></td>
    </tr>
    <tr>
      <td class="jd-typecol"><span class="prettyprint lang-xml">clusterId</span></td>
      <td class="jd-linkcol"><span class="sympad">集群ID。</span>
          <div class="jd-descrdiv">长整型（Long）类型。</div></td>
    </tr>
    <tr class="alt-color">
      <td class="jd-typecol"><span class="prettyprint lang-xml">name</span></td>
      <td class="jd-linkcol"><span class="sympad">主机名称。</span>
          <div class="jd-descrdiv">字符串（String）类型。</div></td>
    </tr>
    <tr>
      <td class="jd-typecol"><span class="prettyprint lang-xml">vmNum</span></td>
      <td class="jd-linkcol"><span class="sympad">主机下虚拟机数量。</span>
          <div class="jd-descrdiv">整型（Integer）类型。</div></td>
    </tr>
	<tr class="alt-color">
      <td class="jd-typecol"><span class="prettyprint lang-xml">vmRunCount</span></td>
      <td class="jd-linkcol"><span class="sympad">主机下运行的虚拟机数量。</span>
          <div class="jd-descrdiv">整型（Integer）类型。</div></td>
    </tr>
	<tr>
      <td class="jd-typecol"><span class="prettyprint lang-xml">vmShutoff</span></td>
      <td class="jd-linkcol"><span class="sympad">主机下关闭的虚拟机数量。</span>
          <div class="jd-descrdiv">整型（Integer）类型。</div></td>
    </tr>
	<tr class="alt-color">
      <td class="jd-typecol"><span class="prettyprint lang-xml">cpuRate</span></td>
      <td class="jd-linkcol"><span class="sympad">主机CPU利用率。</span>
          <div class="jd-descrdiv">小数（Double）类型。</div></td>
    </tr>
	<tr>
      <td class="jd-typecol"><span class="prettyprint lang-xml">memRate</span></td>
      <td class="jd-linkcol"><span class="sympad">主机内存利用率。</span>
          <div class="jd-descrdiv">小数（Double）类型。。</div></td>
    </tr>
	<tr class="alt-color">
      <td class="jd-typecol"><span class="prettyprint lang-xml">status</span></td>
      <td class="jd-linkcol"><span class="sympad">主机状态， 0：不正常，1：正常。</span>
          <div class="jd-descrdiv">整型（Integer）类型。</div></td>
    </tr>
	<tr>
      <td class="jd-typecol"><span class="prettyprint lang-xml">storage</span></td>
      <td class="jd-linkcol"><span class="sympad">主机存储大小。</span>
          <div class="jd-descrdiv">字符串（String）类型。</div></td>
    </tr>
	<tr class="alt-color">
      <td class="jd-typecol"><span class="prettyprint lang-xml">version</span></td>
      <td class="jd-linkcol"><span class="sympad">主机版本。</span>
          <div class="jd-descrdiv">字符串（String）类型。</div></td>
    </tr>
</table>
<p>&nbsp;</p>
<h2><a name="example"></a>应用举例</h2>
    <p>1.查询 CAS系统中ID为“2”的主机池下主机名为“server21”的主机列表。</p>
    <dl>
      <dt><b>请求</b></dt>
      <div class="source">
        <pre class="prettyprint lang-xml">GET http://localhost:8080/cas/casrs/hostpool/host/2?hostName=server21&offset=0&limit=50
accept: application/xml
...
        </pre>
      </div>
      <dt><b>回应</b></dt>
      <div class="source">
        <pre class="prettyprint lang-xml">HTTP/1.1 200 OK<br>Total: 1<br>Content-Type: application/xml<br>Content-Length: 370<br>Date: Tue, 16 Sep 2014 09:44:07 GMT

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;list&gt;<br>  &lt;host&gt;<br>    &lt;id&gt;4&lt;/id&gt;<br>    &lt;hostPoolId&gt;2&lt;/hostPoolId&gt;<br>    &lt;clusterId&gt;1&lt;/clusterId&gt;<br>    &lt;name&gt;server21&lt;/name&gt;<br>    &lt;vmNum&gt;31&lt;/vmNum&gt;<br>    &lt;vmRunCount&gt;29&lt;/vmRunCount&gt;<br>    &lt;vmShutoff&gt;2&lt;/vmShutoff&gt;<br>    &lt;cpuRate&gt;29.675&lt;/cpuRate&gt;<br>    &lt;memRate&gt;52.79483333333334&lt;/memRate&gt;<br>    &lt;status&gt;1&lt;/status&gt;<br>    &lt;storage&gt;884583&lt;/storage&gt;<br>    &lt;version&gt;CVK 2.0 (C0205)&lt;/version&gt;<br>  &lt;/host&gt;<br>&lt;/list&gt;        </pre>
      </div>
    </dl>
    </div>
</div>
</div>
</body>
</html>